Returns the salt combined with a copy of the speicified data
Syntax
Visual Basic (Declaration) | |
---|
Public Overloads Function GetData( _
ByVal data() As Byte _
) As SaltedData |
Parameters
- data
Example
Library/Library.Test/TestSalt.cs
C# | Copy Code |
---|
Salt s = new Salt();
byte[] bytes = new byte[1024];
new Random().NextBytes(bytes);
SaltedData sd = s.GetData(bytes);
Assert.AreEqual(s, sd.Salt);
Assert.AreEqual(bytes, sd.GetDataBytes());
sd = s.GetData(new MemoryStream(bytes));
Assert.AreEqual(s, sd.Salt);
Assert.AreEqual(bytes, sd.GetDataBytes()); |
VB.NET | Copy Code |
---|
Dim s As New Salt()
Dim bytes As Byte() = New Byte(1024) {}
New Random().NextBytes(bytes)
Dim sd As SaltedData = s.GetData(bytes)
Assert.AreEqual(s, sd.Salt)
Assert.AreEqual(bytes, sd.GetDataBytes())
sd = s.GetData(New MemoryStream(bytes))
Assert.AreEqual(s, sd.Salt)
Assert.AreEqual(bytes, sd.GetDataBytes()) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also